<div class="main-content">
	<div class="breadcrumbs" id="breadcrumbs">
		<script type="text/javascript">
			try{ace.settings.check('breadcrumbs' , 'fixed')}catch(e){}
		</script>

		<ul class="breadcrumb">
			<li class="active">
				<i class="icon-home home-icon"></i>
				<a href="#">系统首页</a>
			</li>
			<li>
				<a href="#">系统管理</a>
			</li>
			<li class="active">系统信息</li>
		</ul><!-- .breadcrumb -->
	</div>

	<div class="page-content">
		<div class="row">
		    <div class="page-header">
				<h1>系统信息</h1>
			</div>
			<div class="col-xs-12">
		         <a href="javascript:void(0)" onclick="delSomeModal(2)" data-toggle="modal" class="btn btn-success btn-sm"><i class="icon-edit"></i>标记为已读</a>
		         <a href="javascript:void(0)" onclick="delSomeModal(1)" data-toggle="modal" class="btn btn-sm btn-danger"><i class="icon-trash"></i>删除</a>
			</div>
			<br><br>
            <div class="col-xs-12 margin_t margin_b">
				<div class="table-responsive">
				<form action="<?php echo base_url()."admin/systems/del_some_message"?>" method="post" id="delForm">
                    <table class="table table-striped table-bordered table-hover">
                        <thead>
                        <tr>
                        	<th class="center" style="width: 3%">
                            	<label>
									<input type="checkbox" class="ace" />
									<span class="lbl"></span>
								</label>
                        	</th>
                        	<th>收信人</th>
                        	<th>内容</th>
                        	<th>状态</th>
                        	<th>收信时间</th>
                        	<th style="width: 11%;">操作</th>
                    	</tr>
                        </thead>
                        <tbody>
                        <?php if (isset($result)&&count($result)>0){
                        	foreach ($result as $message){
                        	?>
                        <tr>
                        	<td class="center">
                        		<label>
									<input type="checkbox" class="ace" name="num[]" value="<?php echo $message->id;?>"/>
									<span class="lbl"></span>
								</label>
                        	</td>
                        	<td><?php echo $message->user_name;?></td>
                        	<td><?php echo $message->content;?></td>
                        	<td><?php if ($message->read_flg == 1)echo "未读";else echo "已读";?></p></td>
                        	<td><?php echo $message->create_time;?></td>
                        	<td>
                    	       <a href="<?php echo base_url().'admin/systems/look_message/'.$message->id;?>" class="btn btn-info btn-sm"><i class="icon-edit"></i>查看</a>
	                           <a href="javascript:void(0)" onclick="delmodal('<?php echo $message->id;?>')" data-toggle="modal" class="btn btn-sm btn-danger"><i class="icon-trash"></i>删除</a>
                            </td>
                        </tr>
                        <?php }
                        }else{?>
                        <tr>
                        	<td colspan="6">无数据</td>
                        </tr>
                        <?php }?>
                        </tbody>
                	</table>
                	</form>
                </div>
            </div>
            <div class="col-sm-12">
            	<div class="modal-footer no-margin-top">
                	<div class="pull-left record">
						共<?php echo $count;?>条记录
                    </div>
            		<?php if (isset($page))echo $page;?>
            	</div>
            </div>
		</div><!-- /.row -->
	</div><!-- /.page-content -->
</div><!-- /.main-content -->
<div id="delModal" class="modal fade" role="dialog" aria-hidden="true">
		<div class="modal-dialog" style="width: 300px">
			<div class="modal-content">
				<div class="modal-header">
				  <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
				  <h3>提示信息</h3>
				</div>
				<div class="modal-body">
				  <p>确定要删除该信息吗？</p>
				</div>
				<div class="modal-footer">
				  <a id="delbtn" href="#" class="btn btn-danger">确定</a>
				  <a href="#" class="btn btn-info" data-dismiss="modal" aria-hidden="true">取消</a>
				</div>
			</div>
		</div>
	</div>
	
	<div id="delsomeModal" class="modal fade" role="dialog" aria-hidden="true">
		<div class="modal-dialog" style="width: 300px">
			<div class="modal-content">
				<div class="modal-header">
				  <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
				  <h3>提示信息</h3>
				</div>
				<div class="modal-body">
				  <p id="sm"></p>
				</div>
				<div class="modal-footer">
				  <button id="delsomebtn" type="submit" class="btn btn-danger">确定</button>
				  <a href="#" class="btn btn-info" data-dismiss="modal" aria-hidden="true">取消</a>
				</div>
			</div>
		</div>
	</div>
	
<script type="text/javascript">
function delmodal(id){
	$("#delbtn").attr('href','<?php echo base_url().'admin/systems/del_sys_message/'?>'+id);
    $('#delModal').modal('show');
}
function delSomeModal(type){
	if(checkSelect()){
		if(type == 1){
			$('#sm').html('确定要删除所选信息吗？');
		}else if(type == 2){
			$('#sm').html('确定要把所选信息标记为已读吗？');
			$("#delForm").attr("action", "<?php echo base_url().'admin/systems/up_some_message'?>");
		}
		$('#delsomeModal').modal('show');
	}else{
		if(type == 1){
		    alert('请选择正确的记录进行删除');
		}else if(type == 2){
			alert('请选择正确的记录进行标记');
		}
	}
}
$("#delsomebtn").click(function(){
	$("#delForm").submit();
	show_right();
});
</script>
				